"""
@author: Gaoyaoxia
@date: 2021-03-12 15:43:14
"""
<!-- 公开提案列表 -->
<template>
  <div class="base-table-box">
    <div class="table-select-group">
      <div class="left">
        <s-select
          :selectOption="strSIds"
          v-model="params.strSId"
          style="width: 140px"
        />
        <proposal-type-select
          style="width: 180px"
          placeholder="=提案类别="
          v-model="params.proposalType"
        />
        <s-select
          style="width: 140px"
          :selectOption="proposal.reporterType"
          v-model="params.proposerType"
          placeholder="=提案者类型="
        />
        <s-select
          style="width: 102px"
          :selectOption="proposal.searchType4"
          v-model="params.type"
        ></s-select>
        <a-input
          class="search-input"
          v-model="params.search"
          placeholder="请输入搜索内容"
        />
        <a-button style="margin-left: 16px" type="primary" @click="search"
          >查询</a-button
        >
        <a-button @click="reset" class="btn-reset">重置</a-button>
      </div>
    </div>
    <a-table
      :pagination="pagination"
      :columns="columns"
      :data-source="tableData"
      :loading="loading"
      :scroll="{ x: '100%', y: '100%' }"
    >
      <template slot="caseName" slot-scope="text, record">
        <router-link
          class="link-a"
          :to="{
            path: '/cppccproposal/proposaldetail',
            query: { id: record.id }
          }"
          target="_blank"
        >
          <font color="red" v-if="record.important">[重点]</font>
          {{ text }}
        </router-link>
      </template>
    </a-table>
  </div>
</template>

<script>
import paging from 'mixins/paging'
import proposalTypeSelect from 'components/form/proposalTypeSelect'
import { proposal } from 'assets/js/select-option-list'
const columns = [
  {
    title: '序号',
    dataIndex: 'key',
    width: 80
  },
  {
    title: '案号',
    dataIndex: 'caseNo',
    width: 110,
    sorter: (a, b) => a.name.length - b.name.length
  },
  {
    title: '题目',
    dataIndex: 'caseName',
    width: 280,
    ellipsis: true,
    scopedSlots: { customRender: 'caseName' }
  },
  {
    title: '提案类别',
    dataIndex: 'caseType',
    width: 140
  },
  {
    title: '提案者',
    dataIndex: 'proposer',
    width: 140
  },
  {
    title: '提交时间',
    dataIndex: 'pubDate',
    width: 200,
    sorter: (a, b) => a.name.length - b.name.length
  },
  {
    title: '提案状态',
    dataIndex: 'caseStatus',
    width: 140,
    sorter: (a, b) => a.name.length - b.name.length
  },
  {
    title: '办理状态',
    dataIndex: 'handleStatus',
    width: 140,
    sorter: (a, b) => a.name.length - b.name.length
  }
]

export default {
  mixins: [paging],
  components: { proposalTypeSelect },
  data() {
    return {
      columns,
      proposal,
      //查询
      strSIds: [],
      params: {
        strSId: '十四届四次',
        proposalType: undefined,
        proposerType: undefined,
        type: ''
      },
      //table
      tableData: [],
      loading: false
    }
  },
  computed: {},
  watch: {},
  mounted() {},
  methods: {
    //获取列表数据
    getTableData() {
      this.tableData = [
        {
          key: 1,
          caseNo: '0012',
          caseName: '春运来了,湖南铁路织密疫情防控网1',
          caseType: '',
          proposer: '程翔',
          pubDate: '2021-03-11 16:11',
          caseStatus: '已立案',
          handleStatus: '',
          important: false
        },
        {
          key: 2,
          caseNo: '0008',
          caseName:
            '李克强到湖北武汉考察指导新型冠状病毒感染肺炎疫情防控工作111',
          caseType: '',
          proposer: '程翔',
          pubDate: '2021-03-03 16:11',
          caseStatus: '已立案',
          handleStatus: '',
          important: true
        },
        {
          key: 3,
          caseNo: '0015',
          caseName: '加快村医队伍建设',
          caseType: '',
          proposer: '程翔',
          pubDate: '2021-03-11 16:11',
          caseStatus: '已立案',
          handleStatus: '办理中',
          important: false
        }
      ]
      this.pagination.total = 200
    },
    //查询
    search() {},
    //重置
    reset() {
      this.params = {
        strSId: '十四届四次',
        proposalType: undefined,
        proposerType: undefined,
        type: ''
      }
    }
  },
  created() {}
}
</script>
<style lang='less' scoped>
</style>